package com.atung.parking.config.result;


import java.io.Serializable;
import java.util.List;

/**
 * @author Administrator
 */
public class PageResponse<T> implements Serializable {
    private List<T> list;
    private int pageNum;
    private int pageSize;
    private long total;

    public static <T> PageResponseBuilder<T> builder() {
        return new PageResponseBuilder();
    }

    public List<T> getList() {
        return this.list;
    }

    public int getPageNum() {
        return this.pageNum;
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public long getTotal() {
        return this.total;
    }

    public void setList(final List<T> list) {
        this.list = list;
    }

    public void setPageNum(final int pageNum) {
        this.pageNum = pageNum;
    }

    public void setPageSize(final int pageSize) {
        this.pageSize = pageSize;
    }

    public void setTotal(final long total) {
        this.total = total;
    }
    protected boolean canEqual(final Object other) {
        return other instanceof PageResponse;
    }

    public PageResponse() {
    }

    public PageResponse(final List<T> list, final int pageNum, final int pageSize, final long total) {
        this.list = list;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
    }

    public static class PageResponseBuilder<T> {
        private List<T> list;
        private int pageNum;
        private int pageSize;
        private long total;

        PageResponseBuilder() {
        }

        public PageResponseBuilder<T> list(final List<T> list) {
            this.list = list;
            return this;
        }

        public PageResponseBuilder<T> pageNum(final int pageNum) {
            this.pageNum = pageNum;
            return this;
        }

        public PageResponseBuilder<T> pageSize(final int pageSize) {
            this.pageSize = pageSize;
            return this;
        }

        public PageResponseBuilder<T> total(final long total) {
            this.total = total;
            return this;
        }

        public PageResponse<T> build() {
            return new PageResponse(this.list, this.pageNum, this.pageSize, this.total);
        }

    }
}
